
<html>
<head>
    <style>
        table, th, td {
            border: 1px solid black;
        }
        li.nav-horizontal {
            float: left;
            margin-left: 5px;
        }
        p.message {
            border: 1px solid #EFEFEF;
            background-color: #FACC32;
            padding: 5px;
        }
        p.stronger {
            text-decoration: bold;
        }
        ul.errorlist { color: #b51818; }
        ul.errorlist li { float: left; }
        ul { list-style: none; }
        .nav-inline { list-style: none; margin: 10px 0 10px 5px; }
        .nav-inline li { display: inline; margin-right: 10px; }
    </style>
</head>
<body>
<h1>Logdjango example project</h1>

<ul class="nav-inline">
    <li><a href="{% url home %}">Home</a></li>
    <li><a href="{% url entry_create %}">Add entry</a></li>
    <li><a href="{% url show_log_file %}">Show log file content</a></li>
    <li><a href="{% url log_message %}">Log message</a></li>
</ul>

{% if log_name %}<p class="stronger">Logged with level {{ log_name }}</p>{% endif %}
{% if message %}<p class="message">{{ message }}</p>{% endif %}

{% block content %}
<h2>Entries:</h2>
<table>
    <thead>
        <tr>
            <th>Id</th>
            <th>Name</th>
            <th>Created at</th>
            <th>Hits</th>
        </tr>
    </thead>
    <tbody>
        {% for entry in entry_list %}
        <tr>
            <td>{{ entry.id }}</td>
            <td><a href="{% url entry_details entry.id %}">{{ entry.name }}</a></td>
            <td>{{ entry.created_at }}</td>
            <td>{{ entry.hits }}</td>
        </tr>
        {% endfor %}
    </tbody>
</table>
{% endblock %}
</body>
